import http from '@/utils/request'
import model from "@/config/model";
export default {
  queryWithPage: {
    url: `${model.API_URL}/main-table-management/v1.0/main-table/query-with-page`,
    name: '主-分页查询',
    post: async function (data) {
      return await http.post(this.url, data)
    }
  },
  queryWithNoPage: {
    url: `${model.API_URL}/main-table-management/v1.0/main-table/query-with-no-page`,
    name: '主-不分页查询',
    post: async function (data) {
      return await http.post(this.url, data)
    }
  },
  queryAll: {
    url: `${model.API_URL}/main-table-management/v1.0/main-table/query-all`,
    name: '主-查询所有',
    get: async function () {
      return await http.get(this.url)
    }
  },
  queryById: {
    url: `${model.API_URL}/main-table-management/v1.0/main-table/`,
    name: '主-通过id查询',
    get: async function (data) {
      return await http.get(this.url + data)
    }
  },
  save: {
    url: `${model.API_URL}/main-table-management/v1.0/main-table/save`,
    name: '主-保存',
    post: async function (data) {
      return await http.post(this.url, data)
    }
  },
  modify: {
    url: `${model.API_URL}/main-table-management/v1.0/main-table/modify`,
    name: '主-修改',
    post: async function (data) {
      return await http.post(this.url, data)
    }
  },
  delete: {
    url: `${model.API_URL}/main-table-management/v1.0/main-table/delete/`,
    name: '主-删除',
    get: async function (id) {
      return await http.get(this.url + id)
    }
  },
  deleteBatch: {
    url: `${model.API_URL}/main-table-management/v1.0/main-table/delete-batch`,
    name: '主-批量删除',
    post: async function (data) {
      return await http.post(this.url, data)
    }
  },
}
